function domainName(url){
  let u = new URL(url)
  url = u.host
  console.log(url); 
}
domainName("www.xakep.ru")